package com.greateamd.timetableasy.server.dao;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import org.hibernate.HibernateException;
import org.springframework.security.access.prepost.PreAuthorize;

import com.greateamd.timetableasy.domain.Event;
import com.greateamd.timetableasy.domain.Promotion;
import com.greateamd.timetableasy.domain.exceptions.DBServerSideException;
import com.greateamd.timetableasy.domain.exceptions.IllegalEntityStateException;


public interface PromotionDAO extends IBaseDao<Promotion, Integer> {

	@Override @PreAuthorize("hasRole('ROLE_CAMPUS_MANAGER')")
	void save(Promotion promotion) throws HibernateException,SQLException;
	
	@Override @PreAuthorize("hasRole('ROLE_CAMPUS_MANAGER')")
	public void update(Promotion obj)throws HibernateException,SQLException,IllegalAccessException;
	
	@Override @PreAuthorize("hasRole('ROLE_CAMPUS_MANAGER')")
	public void delete(Promotion obj)throws HibernateException,SQLException,IllegalAccessException;

	@PreAuthorize("hasRole('ROLE_CAMPUS_MANAGER')")
	List<Promotion> getAllOfCampusManager()throws HibernateException,SQLException;
	
	List<Event> getPlanning(Promotion promotion, Date from, Date to)throws DBServerSideException,IllegalEntityStateException;
}
